<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cindy JS</title>

<script type="text/javascript" src="../build/js/Cindy.js"></script>

<link rel="stylesheet" href="../css/cindy.css">
</head>

<body style="font-family:Arial;">

<h1>Discrete Asymptotic Line Catenoid</h1>


<script id='mouseDrag' type='text/x-cindyscript'>
if((mover()!=S) & (mover()!=T),
   xx=mouse().x;
   yy=mouse().y;
   wy=(startx-xx)*.3;
   wx=-(starty-yy)*.3;

   mmmx=[
       [1,0,0],
       [0,cos(wx),sin(wx)],
       [0,-sin(wx),cos(wx)]
       ];


   mmmy=[
       [cos(wy),0,-sin(wy)],
       [0,1,0],
       [sin(wy),0,cos(wy)]
       ];



   mat=mmmx*mmmy*mat;

   startx=mouse().x;
   starty=mouse().y;
   );
</script>

<script id='mouseUp' type='text/x-cindyscript'>

if((mover()!=S) & (mover()!=T),
   xx=mouse().x;
   yy=mouse().y;
   wy=(startx-xx)*.3;
   wx=-(starty-yy)*.3;

   mmmx=[
       [1,0,0],
       [0,cos(wx),sin(wx)],
       [0,-sin(wx),cos(wx)]
       ];


   mmmy=[
       [cos(wy),0,-sin(wy)],
       [0,1,0],
       [sin(wy),0,cos(wy)]
       ];



   mat=mmmx*mmmy*mat;
   );
</script>

<script id='mouseDown' type='text/x-cindyscript'>

startx=mouse().x;
starty=mouse().y;
</script>




<script id='init' type='text/x-cindyscript'>



v=[
[0.14505356740286868,0.9936895342768387,0.05700109612037943],
[0.15179593034971325,0.9828762477671632,0.1759431567779972],
[0.0359501604583719,0.9811293024773182,0.20462171810117075],
[0.0010164698418546336,1.011206362201753,0.06658270146089727],
[0.08655495494296639,0.9572449952516925,0.310252457008042],
[0.17579881420331878,0.9741060247218257,0.2713106382679206],
[-0.09585405214007939,0.9731652811587959,0.2659647523866143],
[-0.01000344247578333,0.932777779550862,0.376197367080635],
[0.0778438444963474,0.905010114325604,0.4521959972909259],
[0.14436441374366518,0.9410079025500889,0.38873589037688555],
[-0.10872689487432023,0.895597280648747,0.4766819057750953],
[0.01524174692782107,0.8570127909684363,0.541907389115449],
[0.12716729533424645,0.835245514675906,0.5771253150462082],
[0.16160306488778195,0.8892373988776575,0.5019783530579486],
[-0.03536932830279535,0.7919560967395821,0.6621864372700665],
[0.10723792375047062,0.7669675003603506,0.6731036068272642],
[0.22591221497600028,0.7600372491442617,0.663470002072198],
[0.2244152989178653,0.8277332923546127,0.5916158668583001],
[0.11146379897131511,0.6801982151484952,0.7903864526392499],
[0.24999349421954312,0.6782346776081114,0.7471320056794551],
[0.35693381878582764,0.692396791502396,0.6963569638268219],
[0.32186941958823756,0.7671374810880615,0.6422059806412039],
[0.30630102308707297,0.5796802975448023,0.839119595483271],
[0.4187538323114789,0.6061643150163369,0.7512490896781424],
[0.49753750359822835,0.6440082324632915,0.6701712977778078],
[0.43707494639622757,0.717915972808506,0.6450727555481762],
[0.5153685986021332,0.5078059262656375,0.7999904658922741],
[0.5842989648330312,0.5632064741129851,0.6848145295381962],
[0.6234138082715219,0.6232117683685672,0.5895060599149182],
[0.5501139905134864,0.688552988349207,0.5997858165296298],
[0.7024459513618886,0.47701011419058686,0.6798215326126296],
[0.7180068277354992,0.5567623307305366,0.5593807807218671],
[0.7128374438816165,0.6335729310327904,0.4683438658700512],
[0.6414809419861581,0.6840952887570909,0.5142105498595229],
[0.8351459299601527,0.49260617805422235,0.49946264791887246],
[0.7967979845541399,0.5879157700261368,0.3966713411326361],
[0.7504031046107036,0.673280596768842,0.32762421881443987],
[0.6954344779615419,0.705294066295937,0.40313315563114255],
[0.8905256959282694,0.5518707915734873,0.29016481796462934],
[0.8071055816749643,0.651260494783173,0.22480961012557488],
[0.7296618295632717,0.7354704364344149,0.1916257483457009],
[0.7026920249608168,0.7484853467556793,0.28570684867574764],
[0.8590494524092684,0.6445261988927041,0.08815240210254688],
[0.7470455942276706,0.736174918597882,0.07277829055792392],
[0.6537709297221436,0.8097553146040671,0.08338887984723045],
[0.6620146812146007,0.8062248066265707,0.1821581716930655],
[0.7492646573120855,0.7534818706832821,-0.0722205048112102],
[0.7500936704871255,0.7351249354253955,0.07221314470560039],
[0.6566034820859606,0.8090863907655444,0.08208421266130263],
[0.6297319402637266,0.8267994864167231,-0.03303887327429125],
[0.5387468716972297,0.8823578880753061,0.0209290815486146],
[0.5822841872781517,0.8684439843753596,0.10864683766969971],
[0.5745768084714483,0.862089908414352,-0.16287657724361965],
[0.4700745642398443,0.9092258664160876,-0.07312009580501966],
[0.399333914376813,0.9419231730427193,0.017456973627342262],
[0.47303861371294503,0.9248622782223902,0.08117543664232432],
[0.36792705000199544,0.9504016516503218,-0.1680715150116151],
[0.2986338896541775,0.9682582969488128,-0.04127111355592181],
[0.26247740422136984,0.9774906026441366,0.07224114161908565],
[0.3557116473273341,0.9652784490504291,0.10292890224083776],
[0.1650470025717111,1.0031471976701907,-0.08690706479947782],
[0.25034849815584825,0.9826798450431529,0.1704639959955328],
[0.25511977093829963,0.987091794266218,0.2526309325728282],
[0.20958473573946795,0.9692181544800881,0.3463323418758812],
[0.27031193405359805,0.992712096215049,0.3205375287056351],
[0.20341864032566587,0.9326542885806144,0.4457638772851323],
[0.2476904152860899,0.9689778988387208,0.40482674236441185],
[0.2378067347176597,0.8840023803535159,0.5328953861441031],
[0.2599710250508096,0.9315655784581698,0.48684995278668636],
[0.3066252989234257,0.8315696028081545,0.5931167332607894],
[0.30507468537202065,0.8873964808341772,0.551228183406784],
[0.39793520144680866,0.7844104990384304,0.6160866542991511],
[0.3750389230763244,0.8438812637248185,0.5875790421803133],
[0.4959503237676579,0.7506526817516305,0.5978987572623566],
[0.4577684803844314,0.8085174770210344,0.5896824528383855],
[0.5837628285364083,0.7361028185174087,0.541732757837137],
[0.5389985327585098,0.7873894753055302,0.5572095794002841],
[0.6462459890257954,0.7432571283993563,0.4572897265792141],
[0.6047405193121921,0.7841308975570583,0.49576473564534895],
[0.6726423821435213,0.7708800532650827,0.35911755497133674],
[0.6436735363049993,0.7993066685398089,0.41591921745366295],
[0.6584038257095066,0.8142191797298596,0.2641135708231337],
[0.6490817053439557,0.8303166008807795,0.33140150775577587],
[0.6059723607626716,0.865820403915803,0.1886252999334273],
[0.6200099701082158,0.8718384203747604,0.25674596027344343],
[0.5798293801335868,0.8688219507684642,0.11029007268327633],
[0.523834668301061,0.9168919971547732,0.14598784823917865],
[0.5614362316644174,0.916738442396092,0.2047966272291778],
[0.5255842504241679,0.9168288428173187,0.14429275397355185],
[0.42827669305862953,0.9584169595297711,0.1418370358159973],
[0.484086908924334,0.9573015722935586,0.18377800131985436],
[0.33213029549267575,0.9833181864447654,0.18054357052684952],
[0.39910461314575413,0.9864031127384624,0.19997325354887044],
[0.32388320424960765,0.998860424647892,0.2481018399579186],
[0.32526155935310463,1.013918479526976,0.30651662387998946],
[0.2911371097774028,1.0005690797409945,0.3766223906652179],
[0.33217816624025975,1.029602474128706,0.35729322113829654],
[0.28645914330971567,0.973299988116282,0.4508619152998975],
[0.31423826177048914,1.0108874009599718,0.4238660041287461],
[0.3121232539458733,0.936565384565613,0.5169693374780917],
[0.32384430923092034,0.9814843001767828,0.48837799670014875],
[0.36361287313627483,0.8973358975729152,0.5620255827580833],
[0.35947719764858116,0.9461623775830459,0.5403239460577919],
[0.4319410724464892,0.8620397713999514,0.5792306196206303],
[0.4147734670049692,0.9117746732833868,0.5690422569011429],
[0.5053331544492053,0.8367496600052367,0.5656444045102774],
[0.48019592081337437,0.8838091643375294,0.570705278003978],
[0.5711558142793814,0.8258188692177285,0.5236055762862979],
[0.544489276818615,0.8670817558183044,0.5450149170088139],
[0.6180741990597439,0.8311389191479699,0.46032995440743874],
[0.596583112411655,0.8644862559376555,0.4963601948536591],
[0.6379916877397918,0.8518137661510128,0.3866809361646582],
[0.6274859240803945,0.8764952915361572,0.4330764224087723],
[0.6274444307751869,0.8843081661858064,0.31531357978933827],
[0.6318344001146722,0.9010720161100644,0.36602641271826597],
[0.5882072786642526,0.9230493574616765,0.25850337946521457],
[0.6088277834175182,0.9340127058994945,0.3067391515082787],
[0.5269993675325811,0.9613823623276835,0.22603152687364614],
[0.5623788030843941,0.9696653426127653,0.26542413679541854],
[0.483131932737499,0.9571775632976371,0.18510586357577416],
[0.45439746326724795,0.9924115707698237,0.22419929721577006],
[0.500419089083414,1.0018701721745034,0.24931850077072545],
[0.45417580330074103,0.9925486840137343,0.22408603722165715],
[0.38280349960210386,1.0110985217445996,0.25265409856160864],
[0.4338657915827223,1.024600134053503,0.26215593051387376],
[0.37438893403667767,1.03445427219951,0.3001999282929952],
[0.37038853337557964,1.0575681491177453,0.3435274984230224],
[0.34164482087285175,1.0462855234633586,0.40267594014350916],
[0.3681228737031693,1.080874175255336,0.38443770078955397],
[0.33762573571754934,1.0232630224358186,0.4654280408522995],
[0.351812276253452,1.063717678011439,0.44532287690927475],
[0.3591993308332306,0.9924206878908333,0.5209041511282576],
[0.3605832836776625,1.0368209239911315,0.5043530029071334],
[0.4028170650237817,0.9587462156750568,0.5601962671324711],
[0.39306612645201044,1.0047635247594826,0.5513461105826883],
[0.46067505310582385,0.9288662952336032,0.5747455069858938],
[0.4438259553509516,0.9727432724658364,0.5788609841787042],
[0.5228699124571391,0.9074417398073121,0.5632140260394464],
[0.5038808053841948,0.9470812422608432,0.5803645927871275],
[0.5786940710490366,0.8981785358853598,0.5275426460364196],
[0.5629370664680351,0.931730007229246,0.5567322655060666],
[0.6185110183870317,0.9027022171092375,0.4738217401038175],
[0.6107993695816092,0.9293677760016271,0.5119727132626374],
[0.635416107712642,0.9202702227624876,0.4112606147627976],
[0.6391719526364879,0.9404426248418214,0.4537457432515168],
[0.6264374293897352,0.9478907002731438,0.3506120868435931],
[0.6431000721389153,0.9630854269946829,0.39205475745315915],
[0.5930621545451086,0.9808315444038757,0.302321029788407],
[0.6218391965908802,0.9934247625261872,0.33752487974442724],
[0.5409613505167884,1.0134018946043666,0.2748307968316732],
[0.5789657036340242,1.0262195953113658,0.29967821213698237],
[0.4791437190389506,1.0399700410264672,0.27289469970174485],
[0.52189280905282,1.0557994005003581,0.2850587880680544],
[0.4340861808537877,1.0247201806215924,0.26161721373112573],
[0.41892182250363286,1.0556291703649539,0.29698103715511115],
[0.46048893523360646,1.0770495615419446,0.2961944380806257],
[0.4190810249210005,1.0551728094210027,0.2979715941975839],
[0.4068146762932743,1.0853074951420303,0.33213964617177144],
[0.39457462714713043,1.1154525039064613,0.36625358001104136],
[0.36583210057118765,1.1041884943600837,0.4253534685700562],
[0.38057364511825886,1.145442751695167,0.40271767396964586],
[0.36197623214188296,1.081128780184649,0.4880270097899848],
[0.3627822142510756,1.1267496571549735,0.4690771534512948],
[0.38356073634613036,1.050350683532178,0.5433283503175497],
[0.37257354283843325,1.097315773406382,0.5334708488785117],
[0.42697278935248645,1.017075996356198,0.5818229325438627],
[0.4080715634297103,1.0624211419190983,0.5844742815088547],
[0.48483484493600054,0.9867403295767938,0.5975257010142037],
[0.4632496228637661,1.0279508789899847,0.6135277037431207],
[0.5471291239391695,0.9652899223761664,0.5859544557183818],
[0.5285944621339497,0.9995906002927833,0.6162759674187915],
[0.6030515046262254,0.9560291783714608,0.5501726555646408],
[0.5930985790917366,0.9828290434142872,0.5904488354644539],
[0.6429125655073337,0.9605989886590751,0.49628777185857803],
[0.6453529614755283,0.9802721520558412,0.5415257570692739],
[0.65977110070301,0.9782550068690481,0.4335524206171299],
[0.6762734865992664,0.9924078508231002,0.4779014056691731],
[0.6506467923541034,1.0059880733266355,0.37277230597945915],
[0.6804483906295209,1.0171814935078007,0.4105352018788656],
[0.6170174954030992,1.0390077995329188,0.3245502527237542],
[0.6570559738450847,1.0503144028791749,0.3511687651217024],
[0.5646980200017059,1.0716047744629462,0.29722429270410167],
[0.6101409968262689,1.0860775974682282,0.31006709242131036],
[0.5027348793104046,1.09814268554356,0.29551933207536607],
[0.5478154858143801,1.1182872966122528,0.2943370358328513],
[0.44184206307284557,1.1140328867215405,0.3197301742087322],
[0.4808560877177925,1.1413741505800798,0.3066984652536492],
[0.40603174179188767,1.0860767960638917,0.3310155586444879],
[0.39310502134652037,1.1164304181544273,0.3653277590319187],
[0.42084069065347873,1.1513462326380501,0.34501397729018846],
[0.39557507796157965,1.1888431142122025,0.3745052452728922],
[0.37852002583818695,1.1464891267012889,0.40223730820826953],
[0.36149264560802896,1.175464907449358,0.44463963582951965],
[0.3648451069264006,1.2257169952886413,0.41154886410223324],
[0.3639278445266272,1.1744768422048504,0.444567174566829],
[0.3593716621467382,1.1472560219740253,0.5185549031222851],
[0.34487338469250983,1.2011021965226065,0.49526500589077993],
[0.3851885704137827,1.110722286379019,0.5839899586105561],
[0.35725018482768406,1.1639109269924357,0.5766246096008273],
[0.43660390382380876,1.071488109790422,0.6291369010732923],
[0.40257024926006885,1.119528815241572,0.6413144991544601],
[0.5048596431615126,1.036126336615258,0.6465855625188928],
[0.47253233017207485,1.0760168991809587,0.677659255412493],
[0.5780504075666686,1.0105218148151285,0.6340116282710943],
[0.5552200595279885,1.0406190387715812,0.679893590122663],
[0.6441757305118001,0.9995733155297332,0.5916967951505873],
[0.6360954291395786,1.0192619982920683,0.6483787602431496],
[0.6912646174315709,1.0049958559692231,0.5279799641017122],
[0.7021945274018578,1.0160248559477778,0.5865007188785145],
[0.711109648706463,1.0258955557405207,0.45383654457126477],
[0.7412574826715801,1.0313825796590186,0.5060551356249571],
[0.7001796171397228,1.0586635775726896,0.38217999849199447],
[0.7464301346519508,1.0626845901944975,0.4210451716524457],
[0.6603644237272561,1.097634032397319,0.3254003944444781],
[0.716818084008736,1.1045184851418526,0.34616982321280126],
[0.5985484774658456,1.136068575059249,0.2933154412591313],
[0.6575415236865846,1.149650804487571,0.2943757177670666],
[0.5254203169618876,1.1673215238474919,0.29147291911842943],
[0.5788499093318344,1.1902777601316665,0.27461852697844186],
[0.4536244654945434,1.1859889600175826,0.32019141686893815],
[0.49434973588063036,1.2193745823144502,0.2903144487647682],
[0.41865185113271564,1.23191016629289,0.33874951540597714],
[0.3741105117095054,1.2783498649230425,0.3663037783261405],
[0.3284772028411127,1.2604151113307172,0.46026467495673595],
[0.31912703445663315,1.3236637531535995,0.40793121363133056],
[0.34227584307737885,1.2019532123999508,0.49585782071009027],
[0.3224093854518823,1.223912363065521,0.5594367063801178],
[0.28769263693584335,1.2905656332659934,0.5253564550933725],
[0.3250010400633931,1.223217278822226,0.5584539847035321],
[0.3594453067031042,1.1744892677578194,0.6457192592845938],
[0.3075030332688396,1.2380984162596156,0.6376414473340549],
[0.42863947140259584,1.1217720647413318,0.706264849169606],
[0.370478413037008,1.1764386559774815,0.7275013747780587],
[0.52000071288616,1.0746373695873639,0.7291183072010058],
[0.4684564777182481,1.1155068306410023,0.7783894659855447],
[0.617981013079367,1.0408884430288237,0.7109447505137747],
[0.5837423459480986,1.066340993214604,0.7810295950242897],
[0.7052738899603266,1.0261875302442134,0.6557135942259029],
[0.6967298505079483,1.037035713610457,0.7356507120027601],
[0.7681276373931184,1.0334175675241888,0.5706851436688264],
[0.7874178063248708,1.0324898005284011,0.6510196707696595],
[0.7945461125075521,1.0612732032337502,0.4718983434143754],
[0.841690744921639,1.0537932867610609,0.5393375146440836],
[0.7799613202718075,1.104937944827575,0.37643432736580407],
[0.8489127662225631,1.0972394941960248,0.4213012351751733],
[0.7268951042472448,1.1568617622166115,0.3007996911008609],
[0.8078351171648048,1.1553161800197143,0.3173203744987495],
[0.6445230949975952,1.2080665555489152,0.25807235067729317],
[0.7255604963829984,1.2179813573169125,0.24537416894710606],
[0.5470881611660223,1.249698550822591,0.25564025164233684],
[0.6163149331621988,1.2743996475998371,0.217902771278568],
[0.4514376881488154,1.2745591979330488,0.29392392590416233],
[0.4989879778705111,1.3148158159804804,0.23965623575982284],
[0.3938665271282915,1.3322415397831786,0.3068731905620623],
[0.3196210967539476,1.3908266726541545,0.33531995011177473],
[0.2542540110868998,1.3652072724504296,0.4697328856830164],
[0.22805130128481282,1.4474864936308813,0.38710984601425125],
[0.24551552738580676,1.3129300357771836,0.6118130612516814],
[0.18205783839449263,1.399150349391428,0.5586886965635535],
[0.30499862749137746,1.2386701457590434,0.6388450237964328],
[0.29494367299146307,1.2430247587297694,0.7369887345881801],
[0.2072843962599076,1.323337057999148,0.7245411880101358],
[0.29742101490664075,1.242462442228867,0.7357899471992293],
[0.3964441081465475,1.1670294447848406,0.8224105481712083],
[0.30187347985464275,1.2325836964032524,0.8547863422588154],
[0.5273845419926194,1.099448975061691,0.8552311870473905],
[0.4443627278613849,1.1439600086539454,0.9288199219808061],
[0.667877760448097,1.0510501409874553,0.8291887763125857],
[0.6128680310486458,1.0718713500084842,0.9332539602686085],
[0.7936939038645685,1.030155334376254,0.748837183450039],
[0.7783159857222213,1.0287362982114205,0.8673726698478389],
[0.8831671043255727,1.040321965623845,0.6281166380406442],
[0.9121736776609292,1.0219720142692494,0.7425933462605001],
[0.9210476690510089,1.0801404133038286,0.48678157157886154],
[0.9915350433768578,1.053070277562541,0.5794193444632327],
[0.9002621562266087,1.1425916735415662,0.3501658733008776],
[1.0021504662474325,1.1165317820088025,0.4069344649934103],
[0.8244045686074033,1.2168773569383562,0.24189163628576488],
[0.9421844467601354,1.2013834566074264,0.25496291218655376],
[0.7065913724556837,1.2901527937054214,0.18068046048964276],
[0.8220056518488126,1.2929536763934442,0.1497819469238756],
[0.567193539624968,1.3497479950751212,0.17711631449831128],
[0.6623940874806754,1.3754091182546746,0.10957831418242088],
[0.4303142219099186,1.385358409372684,0.23181547148890413],
[0.4909480431860219,1.434492487159123,0.14130358740987575],
[0.3373120976353672,1.459987731969859,0.2394721785176988],
[0.21749807381603198,1.5359651778730514,0.27219475032552576],
[0.12064401523176942,1.4979645171548452,0.47145664950291866],
[0.10773820914810665,1.4204534221231522,0.6820641844460286],
[0.1810121870056515,1.316834265272838,0.867601398686395],
[0.2995277828561924,1.233045744464847,0.856100247842911],
[0.3303006179902772,1.2044520106166068,0.9947836470118191],
[0.5246831268536536,1.1041162342558797,1.0435362955406995],
[0.7333027879411431,1.0322574179762005,1.0048426804796409],
[0.9201500608162826,1.0012543976184196,0.8854441777697841],
[1.0529918945273915,1.0164265957753997,0.7060116950879846],
[1.109097877468951,1.0754727748399822,0.49649861474393037],
[1.0782394581528099,1.1680611797536913,0.2940011863331395],
[0.9657523433903893,1.2781824346561783,0.13353305431869694],
[0.7910865732720714,1.3867955739543019,0.04284061687492763],
[0.5844434470755342,1.4751203990585433,0.03760542054691743],
[0.3815534387994296,1.5278847451655335,0.11873267841357342]
];



f =[[1,2,3,4],[5,3,2,6],[7,3,5,8],[9,8,5,10],[11,8,9,12],[13,12,9,14],[15,12,13,16],[17,16,13,18],[19,16,17,20],[21,20,17,22],[23,20,21,24],[25,24,21,26],[27,24,25,28],[29,28,25,30],[31,28,29,32],[33,32,29,34],[35,32,33,36],[37,36,33,38],[39,36,37,40],[41,40,37,42],[43,40,41,44],[45,44,41,46],[47,48,49,50],[51,50,49,52],[53,50,51,54],[55,54,51,56],[57,54,55,58],[59,58,55,60],[61,58,59,1],[2,1,59,62],[62,63,6,2],[64,6,63,65],[5,6,64,10],[66,10,64,67],[9,10,66,14],[68,14,66,69],[13,14,68,18],[70,18,68,71],[17,18,70,22],[72,22,70,73],[21,22,72,26],[74,26,72,75],[25,26,74,30],[76,30,74,77],[29,30,76,34],[78,34,76,79],[33,34,78,38],[80,38,78,81],[37,38,80,42],[82,42,80,83],[41,42,82,46],[84,46,82,85],[45,46,84,86],[87,86,84,88],[51,52,89,56],[90,56,89,91],[55,56,90,60],[92,60,90,93],[59,60,92,62],[63,62,92,94],[94,95,65,63],[96,65,95,97],[64,65,96,67],[98,67,96,99],[66,67,98,69],[100,69,98,101],[68,69,100,71],[102,71,100,103],[70,71,102,73],[104,73,102,105],[72,73,104,75],[106,75,104,107],[74,75,106,77],[108,77,106,109],[76,77,108,79],[110,79,108,111],[78,79,110,81],[112,81,110,113],[80,81,112,83],[114,83,112,115],[82,83,114,85],[116,85,114,117],[84,85,116,88],[118,88,116,119],[87,88,118,120],[121,120,118,122],[90,91,123,93],[124,93,123,125],[92,93,124,94],[95,94,124,126],[126,127,97,95],[128,97,127,129],[96,97,128,99],[130,99,128,131],[98,99,130,101],[132,101,130,133],[100,101,132,103],[134,103,132,135],[102,103,134,105],[136,105,134,137],[104,105,136,107],[138,107,136,139],[106,107,138,109],[140,109,138,141],[108,109,140,111],[142,111,140,143],[110,111,142,113],[144,113,142,145],[112,113,144,115],[146,115,144,147],[114,115,146,117],[148,117,146,149],[116,117,148,119],[150,119,148,151],[118,119,150,122],[152,122,150,153],[121,122,152,154],[155,154,152,156],[124,125,157,126],[127,126,157,158],[158,159,129,127],[160,129,159,161],[128,129,160,131],[162,131,160,163],[130,131,162,133],[164,133,162,165],[132,133,164,135],[166,135,164,167],[134,135,166,137],[168,137,166,169],[136,137,168,139],[170,139,168,171],[138,139,170,141],[172,141,170,173],[140,141,172,143],[174,143,172,175],[142,143,174,145],[176,145,174,177],[144,145,176,147],[178,147,176,179],[146,147,178,149],[180,149,178,181],[148,149,180,151],[182,151,180,183],[150,151,182,153],[184,153,182,185],[152,153,184,156],[186,156,184,187],[155,156,186,188],[189,188,186,190],[190,191,192,189],[193,192,191,194],[160,161,195,163],[196,163,195,197],[162,163,196,165],[198,165,196,199],[164,165,198,167],[200,167,198,201],[166,167,200,169],[202,169,200,203],[168,169,202,171],[204,171,202,205],[170,171,204,173],[206,173,204,207],[172,173,206,175],[208,175,206,209],[174,175,208,177],[210,177,208,211],[176,177,210,179],[212,179,210,213],[178,179,212,181],[214,181,212,215],[180,181,214,183],[216,183,214,217],[182,183,216,185],[218,185,216,219],[184,185,218,187],[220,187,218,221],[186,187,220,190],[191,190,220,222],[222,223,194,191],[224,194,223,225],[193,194,224,226],[227,226,224,228],[196,197,229,199],[230,199,229,231],[198,199,230,201],[232,201,230,233],[200,201,232,203],[234,203,232,235],[202,203,234,205],[236,205,234,237],[204,205,236,207],[238,207,236,239],[206,207,238,209],[240,209,238,241],[208,209,240,211],[242,211,240,243],[210,211,242,213],[244,213,242,245],[212,213,244,215],[246,215,244,247],[214,215,246,217],[248,217,246,249],[216,217,248,219],[250,219,248,251],[218,219,250,221],[252,221,250,253],[220,221,252,222],[223,222,252,254],[254,255,225,223],[256,225,255,257],[224,225,256,228],[258,228,256,259],[227,228,258,260],[261,260,258,262],[230,231,263,233],[264,233,263,265],[232,233,264,235],[266,235,264,267],[234,235,266,237],[268,237,266,269],[236,237,268,239],[270,239,268,271],[238,239,270,241],[272,241,270,273],[240,241,272,243],[274,243,272,275],[242,243,274,245],[276,245,274,277],[244,245,276,247],[278,247,276,279],[246,247,278,249],[280,249,278,281],[248,249,280,251],[282,251,280,283],[250,251,282,253],[284,253,282,285],[252,253,284,254],[255,254,284,286],[286,287,257,255],[256,257,288,259],[258,259,289,262],[261,262,290,291],[264,265,292,267],[266,267,293,269],[268,269,294,271],[270,271,295,273],[272,273,296,275],[274,275,297,277],[276,277,298,279],[278,279,299,281],[280,281,300,283],[282,283,301,285],[284,285,302,286]]     ;

mid=sum(v)/length(v);
v=apply(v,(#-mid)*2.6);
use("Cindy3D");



mat=[
    [1,0,0],
    [0,1,0],
    [0,0,1]
    ];
mat=[[0.56,0.49,-0.67],[-0.52,-0.42,-0.74],[-0.65,0.76,0.02]];
mat0=[
    [1,0,0],
    [0,1,0],
    [0,0,1]
    ];



mmmx=mat0;
mmmy=mat0;




</script>


<script id='tick' type='text/x-cindyscript'>

</script>



<script id='csmove' type='text/x-cindyscript'>
y=S.y;
if(y<S1.y,y=S1.y);
if(y>S2.y,y=S2.y);

S.xy=(S1.x,y);

s1=(|S,S1|/|S1,S2|);


y=T.y;
if(y<T1.y,y=T1.y);
if(y>T2.y,y=T2.y);

T.xy=(T1.x,y);

al=(|T,T1|/|T1,T2|);

vv=apply(v,mat*#);

f=sort(f,fa,sum(fa,p,(vv_p)_3));

s1=3*exp(s1*5);

mapt(pt):=[pt_1,#_2]/(s1-#_3)*s1*6+(2,2);

apply(f,q,
      pol=apply(q,vv_#);
      d=sum(pol)_3*.2+1.0;
      n=cross(pol_1-pol_3,pol_2-pol_4);
      n=n/|n|;
      col=(0.4,0.4,.7);
      col=col+max(((n*(1,5,5)),0))*(.8,.6,.6)*.1;
      col=col+max(((n*(-1,5,5)),0))*(.6,.4,.6)*.1;
      pol=apply(pol,mapt(#));
      fillpoly(pol,color->(col-(0.5,0.5,0))*d,alpha->al);
      pol=pol++[pol_1];
      forall(1..4,draw(pol_#,pol_(#+1),size->2,color->col*d*.02));

      );

drawtext(S1-(1.8,1),size->16,"perspective");
drawtext(T1-(1,1),size->16,"alpha");


</script>


<script id='timer' type='text/x-cindyscript'>
wx=wx*0.998;
wy=wy*0.998;
wx=.01;
wy=.01;
sp=0.8;
mmmx=[
    [1,0,0],
    [0,cos(wx*sp),sin(wx*sp)],
    [0,-sin(wx*sp),cos(wx*sp)]

    ];


mmmy=[
    [cos(wy*sp),0,-sin(wy*sp)],
    [0,1,0],
    [sin(wy*sp),0,cos(wy*sp)]
    ];


mat=mmmx*mmmy*mat;
</script>

<div  id="CSCanvas" style="width:800px; height:600px; border:2px solid #000000"></div>

<script type="text/javascript">

var gslp=[
    {name:"A", kind:"P", type:"Free",alpha:0, pos:[-1000,-1000,1],alpha:.001} ,
    {name:"S1", type:"Free", pos:[16,-4],color:[0,0,0],pinned:true,size:2},
    {name:"S2", type:"Free", pos:[16,10],color:[0,0,0],pinned:true,size:2},
    {name:"S", type:"Free", pos:[16,1.5],color:[1,0.5,0.5],pinned:false,size:4,narrow:true},
    {name:"l", type:"Segment", args:["S1","S2"],color:[0,0,0],pinned:false,size:2},
     {name:"T1", type:"Free", pos:[20,-4],color:[0,0,0],pinned:true,size:2},
    {name:"T2", type:"Free", pos:[20,10],color:[0,0,0],pinned:true,size:2},
    {name:"T", type:"Free", pos:[20,8.5],color:[1,0.5,0.5],pinned:false,size:4,narrow:true},
    {name:"m", type:"Segment", args:["T1","T2"],color:[0,0,0],pinned:false,size:2}


    ];

CindyJS({canvasname:"CSCanvas",
movescript:"csmove",
initscript:"init",
mousedownscript:"mouseDown",
mouseupscript:"mouseUp",
tickscript:"timer",
mousedragscript:"mouseDrag",
geometry:gslp});


</script>

</body>
</html>
